CXX = g++
RM = rm -f
CAIRO = -I/usr/include/cairo -lcairo -lcairomm-1.0
OBJS = waveplot makeb3table makeFreqList rawhammond mid2wav


waveplot: src/wave_atom.o src/wave_atom.h src/EXEwaveplot.cpp src/wave_plot.h
	$(CXX) src/wave_atom.o src/EXEwaveplot.cpp -o waveplot $(CAIRO) -lm

makeb3table: src/wave_atom.o src/EXEmakeb3table.cpp src/wave_atom.h
	$(CXX) src/wave_atom.o src/EXEmakeb3table.cpp -o makeb3table -lm

makeFreqList: src/makeFreqList.cpp
	$(CXX) src/makeFreqList.cpp -o makeFreqList -lm

rawhammond: src/EXErawhammond.cpp src/welltempMore.h src/key2wheel.h
	$(CXX) src/EXErawhammond.cpp -o rawhammond -lm

mid2wav: contrib/libsmf/smf_load.c contrib/libsmf/smf_decode.c contrib/libsmf/smf_save.c contrib/libsmf/smf_tempo.c contrib/libsmf/smf.c src/filters.h src/filters.c src/B3_defines.h src/B3_consts.h src/gentone.h src/gentone.c src/drawbar.h src/drawbar.c src/playnote.h src/playnote.c src/save_wav.h src/save_wav.c src/effect.h src/effect.c src/EXEmid2wav.c contrib/libsmf/smf.h src/midi_pp.h src/midi_pp.c
	$(CC) contrib/libsmf/smf_load.c contrib/libsmf/smf_decode.c contrib/libsmf/smf_save.c contrib/libsmf/smf_tempo.c contrib/libsmf/smf.c src/midi_pp.c src/gentone.c src/drawbar.c src/playnote.c src/save_wav.c src/filters.c src/effect.c src/EXEmid2wav.c -o mid2wav -I/usr/local/include/glib-2.0 -L/usr/local/lib -lglib-2.0 -lm

src/wave_atom.o: src/wave_atom.cpp src/wave_atom.h
	$(CXX) -c src/wave_atom.cpp -o src/wave_atom.o -lm

clean:
	$(RM) $(OBJS) src/*.o
